using System;
using Castle.ActiveRecord;
using CosyTrade.Data;
using CosyTrade.Organization;

namespace CosyTrade.Financial
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tbPayrollTable"), Serializable]
    public class PayrollTableBase : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        private Company onCompany;
        private DateTime createDate = DateTime.Now;
        private DateTime startCalcDate;
        private DateTime endCalcDate;
        private Employee createEmployee;
        private double totalMoney;
        private double payMoney;

        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID",
            Access = PropertyAccess.NosetterCamelcase)]
        public override Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [BelongsTo("companyGuid")]
        public Company OnCompany
        {
            get { return onCompany; }
            set { onCompany = value; }
        }

        [Property]
        public DateTime CreateDate
        {
            get { return createDate; }
            set { createDate = value; }
        }

        [Property]
        public DateTime StartCalcDate
        {
            get { return startCalcDate; }
            set { startCalcDate = value; }
        }

        [Property]
        public DateTime EndCalcDate
        {
            get { return endCalcDate; }
            set { endCalcDate = value; }
        }

        [BelongsTo("employeeGuid")]
        public Employee CreateEmployee
        {
            get { return createEmployee; }
            set { createEmployee = value; }
        }

        [Property]
        public double TotalMoney
        {
            get { return totalMoney; }
            set { totalMoney = value; }
        }

        [Property]
        public double PayMoney
        {
            get { return payMoney; }
            set { payMoney = value; }
        }
    }
}